package com.itheima.网络编程.tcp编程.tcp编程.tcp网络编程;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class TcpServerDemo1 {
    public static void main(String[] args) throws IOException {
        ServerSocket ss=new ServerSocket(10000);
        Socket accept = ss.accept();
        while (true){
            InputStream inputStream = accept.getInputStream();
            byte[] bys=new byte[1024*1024];
            int len=inputStream.read(bys);
            String s = new String(bys, 0, len);
            System.out.println(s);
            inputStream.close();
        }
    }
}
